<template>
    <div id="app">
    <!-- <div v-if="is_show_waiting" class="pass_change_finish">请稍后...</div> -->
    <div>
        <div class="register_con">
            <div class="l_con fl">
                 <link rel="stylesheet" type="text/css" href="../../static/css/reset.css">
                 <link rel="stylesheet" type="text/css" href="../../static/css/main.css">
                <a class="reg_logo"><img src="../../static/images/logo.png"></a>
                <div class="reg_slogan">商品美 · 种类多 · 欢迎光临</div>
                <div class="reg_banner"></div>
            </div>

            <div class="r_con fr">
                <div class="reg_title clearfix">
                    <h1>绑定用户</h1>
                </div>
                <div class="reg_form clearfix" id="app" v-cloak>
                    <form id="reg_form" v-on:submit.prevent="on_submit">
                        <ul>
                            <li>
                                <label>手机号:</label>
                                <input type="text" v-model="mobile" name="phone" id="phone">
                                <!-- <span v-show="error_phone" class="error_tip">{{ error_phone_message }}</span> -->
                            </li>
                            <li>
                                <label>密码:</label>
                                <input type="password" v-model="password" name="pwd" id="pwd">
                                <!-- <span v-show="error_password" class="error_tip">密码最少8位，最长20位</span> -->
                            </li>
                            <li>
                                <label>短信验证码:</label>
                                <input type="text" v-model="sms_code" v-on:blur="check_sms_code()" name="msg_code"
                                       id="msg_code" class="msg_input">
                                <a class="get_msg_code" input type="button" @click="send_sms_code()">{{ sms_code_tip }}</a>
                                <!-- <span v-show="error_sms_code" class="error_tip">{{ error_sms_code_message }}</span> -->
                            </li>
                            <li class="reg_sub">
                                <input type="button" value="保 存" name="" @click="mobil_zhuce()">
                            </li>
                        </ul>
                    </form>
                </div>
            </div>
        </div>

        <div class="footer no-mp">
            <div class="foot_link">
                <a href="#">关于我们</a>
                <span>|</span>
                <a href="#">联系我们</a>
                <span>|</span>
                <a href="#">招聘人才</a>
                <span>|</span>
                <a href="#">友情链接</a>
            </div>
            <p>CopyRight © 2016 北京美多商业股份有限公司 All Rights Reserved</p>
            <p>电话：010-****888 京ICP备*******8号</p>
        </div>
    </div>
</div>    
</template>

<script>
import axios from "axios"
export default {
    name:"binduser",
    data() {
        return {
           mobile:"", 
           password:"",
           sms_code:"",
           sms_code_tip:"发送短信验证码"
           
        }
    },
    methods:{
        check_sms_code(){

        },
        send_sms_code(){
            var data = new FormData()
            data.append("phone",this.mobile)
            axios({
                url:"http://127.0.0.1:8000/users/binduser/",
                method:"post",
                data:data
            }).then(res=>{
                console.log(res.data)
            })
        },
        mobil_zhuce(){
            var data=new FormData()
            data.append("phone",this.mobile)
            data.append("password",this.password)
            data.append("code",this.sms_code)
            axios({
                url:"http://127.0.0.1:8000/users/check/",
                method:"POST",
                data:data
            }).then(res=>{
                console.log(res.data)
            })
        }

    }
}
</script>

<style>

</style>
